﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace Eniux.Windows.Interactivity
{
    /// <summary>
    ///  附加交互功能类
    /// </summary>
    public class Interaction
    {
        #region 交互
        /// <summary>
        /// Triggers属性
        /// </summary>
        public static readonly DependencyProperty TriggersProperty =
        DependencyProperty.RegisterAttached("Triggers", typeof(TriggerCollection), typeof(Interaction),
        new FrameworkPropertyMetadata(new TriggerCollection(),
        new PropertyChangedCallback(OnTriggersPropertyChanged)));

        /// <summary>
        /// 获取给定依赖对象的Triggers附加属性的值
        /// </summary>
        /// <param name="d">依赖对象</param>
        /// <returns>Triggers附加属性的值returns>
        public static TriggerCollection GetTriggers(DependencyObject d)
        {
            return (TriggerCollection)d.GetValue(TriggersProperty);
        }

        /// <summary>
        /// 设置给定依赖对象的Triggers附加属性的值
        /// </summary>
        /// <param name="d">依赖对象</param>
        /// <param name="value">值</param>
        public static void SetTriggers(DependencyObject d, TriggerCollection value)
        {
            d.SetValue(TriggersProperty, value);
        }

        private static void OnTriggersPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
        } 
        #endregion
    }
}
